package com.example.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
* <p>
* 部门表
* </p>
*
* @author wsl
* @since 2022-03-26
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "Department对象", description = "部门表")
public class Dept implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("部门编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("部门名称")
    private String deptName;

    @ApiModelProperty("公司编号")
    private Integer companyId;

    @ApiModelProperty("部门地址")
    private String address;

    @ApiModelProperty("父部门编号")
    private Integer parentId;

    @ApiModelProperty("是否为上级部门。（0否，1是）")
    @TableField(value = "isParent")
    private Integer isParent;

    @ApiModelProperty("排序")
    private Integer sort;

    @ApiModelProperty("部门负责人")
    private String principalName;

    @ApiModelProperty("部门负责人编号")
    private Integer principalId;

    @ApiModelProperty("是否启用。(0未启用,1启用)")
    private Integer enabled;

    @ApiModelProperty("岗位编号")
    private Integer positionId;

    @ApiModelProperty("修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("是否删除")
    private Integer deleted;

    @ApiModelProperty("子部门")
    @TableField(exist = false)
    private List<Dept> children;

    @ApiModelProperty("公司名称")
    @TableField(exist = false)
    private String companyName;

    @ApiModelProperty("员工集合")
    @TableField(exist = false)
    private List<Emp> emps;
}
